import 'package:flutter/material.dart';
import 'package:news_demo/Pojo/AttentionPersion.dart';

import '../../AttentionHomeIndex/ItmeIndex.dart';

class Itme extends StatelessWidget {
  final AttentionPersion APS;
  const Itme({Key? key,required this.APS}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: (){
        Navigator.push(context, MaterialPageRoute(builder: (context)=>ItmeIndex(keys: APS.keys,)));
      },
      child: Container(
        width: double.infinity,
        height: 80,
        color: Colors.cyan,
        child: Row(
          // mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            //左边
            Expanded(
              child:Container(
                height: 66,
                child: Image.network(
                APS.image,),
              ),
              flex: 3,
            ),
            //中间
            Expanded(child: Container(
              padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
              alignment: Alignment.centerLeft,
              height: double.infinity,
              child: Text(APS.persionName,
                style: TextStyle(fontSize: 18),
                maxLines: 1,
                overflow: TextOverflow.ellipsis,
              ),
            ),
              flex: 6,),
            //右边
            Expanded(child: Container(
              padding: EdgeInsets.fromLTRB(0, 0, 10, 0),
              width: double.infinity,
              alignment: Alignment.centerRight,
              child: Icon(Icons.keyboard_arrow_right,size: 40,),
            ),
              flex: 3,),
          ],
        ),
      ),
    );
  }
}